package com.lvwenguo.controller;

import com.lvwenguo.service.ServiceInter;
import com.lvwenguo.service.serviceImple.ServiceImple;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//商品更新（修改）数据回显与表单
@WebServlet(name = "ProductUpdateServlet",urlPatterns = "/ProductUpdateServlet/product/product_modify")
public class ProductUpdateServlet extends HttpServlet {
    ServiceInter serviceImpol =new ServiceImple();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        req.setAttribute("formProduct", serviceImpol.selectProductBar_codeList(req.getParameter("Bar_code")));
        req.getRequestDispatcher("/view/product/product_modify.jsp").forward(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doGet(req,resp);
    }
}
